Skip to content

feat: load Windows system CA certificates at startup#109

Merged
edospadoni merged 1 commit intomainfrom
support-custom-ca
Mar 19, 2026
Merged

feat: load Windows system CA certificates at startup#109
edospadoni merged 1 commit intomainfrom
support-custom-ca

Conversation

@edospadoni
Copy link
Copy Markdown
Member

Summary

On Windows, NethLink uses Node.js's built-in TLS stack (via axios) to make HTTPS requests. Node.js does not read the Windows Certificate Store by default, which means installations where the NethVoice server uses a certificate signed by a custom or enterprise CA would fail with unable to verify the first certificate, even if that CA is correctly installed in the system store.

Environment variable workarounds (NODE_EXTRA_CA_CERTS, NODE_USE_SYSTEM_CA) are either unreliable in packaged Electron apps or require Node.js 24+ (Electron 28 ships Node.js 18).

This PR adds the win-ca package, which reads the Windows Certificate Store at startup and injects all trusted CAs into Node.js's TLS context. The import is guarded by a process.platform === 'win32' check so it has no effect on macOS and Linux.

Changes

  • Add win-ca dependency
  • Import and initialize win-ca at the very top of main.ts, before any network activity, on Windows only

Add win-ca to inject Windows Certificate Store CAs into Node.js TLS
context on Windows, enabling HTTPS connections to servers using
custom/enterprise CA certificates without requiring environment
variable workarounds.
@github-actions
Copy link
Copy Markdown

Automatic builds from https://github.com/NethServer/nethlink/actions/runs/23287840418.
Commit: a851b05

Name Platform Link
win-app.exe Windows (x64) Link
macos-app-x64.dmg MacOS (x64) Link
macos-app-arm64.dmg MacOS (arm64) Link
linux-app.AppImage Linux (x64) Link

@viktec
Copy link
Copy Markdown

viktec commented Mar 19, 2026

verified

@edospadoni edospadoni merged commit 8dc42e5 into main Mar 19, 2026
4 checks passed
@edospadoni edospadoni deleted the support-custom-ca branch March 19, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants